﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FirebirdSql.Data.FirebirdClient;


namespace connections._class
{
    public class Firebird
    {
        private string connString = "user = SYSDBA; Password=masterkey;Database=H:\\sysvendas\\Syscaixa\\Syscaixa\\Syscaixa\\database\\SYSCAIXA.FDB; DataSource=localhost;Dialect=3;Charset=WIN1252;";        
        private FbConnection conn;

        public string connect()
        {
            string retorno;
            conn = new FbConnection(this.connString);
            
            try
            {
                this.conn.Open();
                retorno = "Conectado ao Banco!";
            }
            catch (FbException ex)
            {
                retorno = ex.Message;
            }
            finally
            {
                this.conn.Close();
            }

            return retorno;
        }
    }
}
